home *** CD-ROM | disk | FTP | other *** search
- Path: fido.asd.sgi.com!news
- From: austern@isolde.mti.sgi.com (Matt Austern)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Date: 22 Jan 1996 18:09:04 GMT
- Organization: SGI
- Distribution: world
- Message-ID: <AUSTERN.96Jan22100904@isolde.mti.sgi.com>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com>
- <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu>
- <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu>
- <30fe666e.3349285@130.15.126.54> <4dmjt8$6sv@crc-news.doc.ca>
- <30ff9519.1799465@130.15.126.54> <4doe07$4u8@crc-news.doc.ca>
- <30ffe557.16481026@130.15.126.54> <GK+N9LA3rQAxEwdx@dakal.demon.co.uk>
- Reply-To: austern@mti.sgi.com
- NNTP-Posting-Host: isolde.mti.sgi.com
- In-reply-to: Richard Linsley Hood's message of Sat, 20 Jan 1996 15:32:07 +0000
-
- In article <GK+N9LA3rQAxEwdx@dakal.demon.co.uk> Richard Linsley Hood <richardlh@dakal.demon.co.uk> writes:
-
- > The method and order by which comparisons are done is determined by the
- > list. This is quite reasonably part of its function. It 'knows' about
- > which two items should be compared to determine which is larger,
- > smaller, etc., thus it is part of its function.
- >
- > The comparison of two objects should be done by themselves, 'are you
- > larger, smaller than this object' thus hiding from the list how this is
- > done. Only an object 'knows' how it compares to another object (of the
- > same type). This is quite reasonably a function of the object.
- >
- > Where is the problem?
-
- The problem is that I might want to have one list of employees
- arranged alphabetically by last name, one list arranged alphabetically
- by first name, another arranged by numerical value of the employee ID,
- and another arranged chronologically by date of hire.
-
- For a nontrivial object (like an employee record), there are too many
- reasonable choices for the comparison function. An object shouldn't
- necessarily impose one choice on all of its clients.
- --
- Matt Austern
- SGI: MTI Compilers Group
- austern@isolde.mti.sgi.com
-